<!--{template admin/header}-->


<div id="main_wp" class="mt10">
	<script type="text/JavaScript">
		var rowtypedata = [
			[
				[1,'', 'td2'],
				[1, '<input type="text" name="slide_new_order[group][]" value="0" size="1"/>', 'td2'], 
				[1, '<input name="slide_new_name[group][]" value="" type="text" style="width:80px; height:15px;"/>', 'td2'],
				[1, '<input name="slide_new_code[group][]" value="" type="text" style="width:80px; height:15px;"/>', 'td2'],
				[1, '<input name="slide_new_url[group][]" value="" type="text" style="width:300px; height:15px;"/>', 'td2'],
				[1, '<select name="slide_new_target[group][]"style="width:80px;"><option value="_parent">本窗口</option><option value="_blank">新窗口</option></select>','td2'],
				[1,'<input type="checkbox" name="slide_new_avaliable[group][]" checked value="1"/>','td2'],
				[1,'<input type="checkbox" name="" checked value="1"/>','td2'],
				[1,'<input type="checkbox" name="" checked value="1"/>','td2'],
				[1,'<input type="checkbox" name="" checked value="1"/>','td2'],
				[2,'', 'td2']
			],
			[
				[1,'', 'td2'],
				[1,'<input type="text" name="type_new_order[{1}][]" value="0" size="1"/>', 'td2'], 
				[1, '<i class="lower"></i><input name="type_new_name[{1}][]" value="" type="text" style="width:80px; height:15px;"/>', 'td2'],
				[1, '<input name="type_new_code[{1}][]" value="" type="text" style="width:80px; height:15px;"/>', 'td2'],
				[1, '<input name="type_new_url[{1}][]" value="" type="text" style="width:300px; height:15px;"/>', 'td2'],
				[1,'<select name="type_new_target[{1}][]"style="width:80px;"><option value="_parent">本窗口</option><option value="_blank">新窗口</option></select>','td2'],
				[1,'<input type="checkbox" name="type_new_avaliable[{1}][]" checked value="1"/>','td2'],
				[2,'', 'td2']
			],
		];
		
		var addrowdirect = 0;
		function addrow(obj, type,group) {
			var table = obj.parentNode.parentNode.parentNode;
			if(!addrowdirect) {
				var row = table.insertRow(obj.parentNode.parentNode.rowIndex);
			} else {
				var row = table.insertRow(obj.parentNode.parentNode.rowIndex + 1);
			}
			var typedata = rowtypedata[type];
			for(var i = 0; i <= typedata.length - 1; i++) {
				var cell = row.insertCell(i);
				cell.colSpan = typedata[i][0];
				var tmp = typedata[i][1];
				if(typedata[i][2]) {
					cell.className = typedata[i][2];
				}

				tmp = tmp.replace('{group}', group);
				cell.innerHTML = tmp;
			}
			addrowdirect = 0;
		}
		
		function uploadicon(obj){
			navkey = $(obj).attr("name");
			group = $(obj).attr("data-group");
			name = $(obj).attr("data-name");
			document.forminfo.target="uploadframe";
			document.forminfo.action="admin.php?mod=setting&code=modify_left_icon&key="+navkey+"&group="+group+"&name="+name;
			$("#forminfo").submit();
			document.forminfo.action="admin.php?mod=setting&code=do_side_navigation";
		}
	</script>
	<iframe id="uploadframe" name="uploadframe" width="0" height="0" marginwidth="0" frameborder="0" src="about:blank"></iframe>
	<form action="admin.php?mod=setting&code=do_left_navigation" method="post" name="forminfo" id="forminfo" enctype="multipart/form-data" >
	<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="tableborder tl">
		<tr class="header">
			<td colspan="9">左侧导航菜单设置</td>
		</tr>
		<tr class="list_h">
			<td width="5%">删?</td>
		    <td width="12%" title="数值大的优先显示">显示顺序</td>
			<td width="15%" style="color:red;">*导航菜单名称(不可留空)</td>
			<td width="10%" style="color:red;">*唯一英文名称(不可留空)</td>
			<td>链接地址（站内以index.php开头，站外url以http://开头）</td>
			<td>打开方式</td>
			<td width="5%">启用</td>
            <!--新导航 13/11/04 begin-->
            <td width="5%">顶部显示</td>
            <td width="5%">侧边显示</td>
            <td width="5%">悬浮显示</td>
            <!--新导航 13/11/04 end-->
			<td width="10%" colspan="2">图标</td>
		</tr>
		<!--{loop $slide_list $key $slideGroup}-->
		
		
			<!--{if $key=='mine'}-->
			<tr><td colspan="9" class="td2">上部</td></tr>
			<!--{elseif $key=='myapp'}-->
			<tr><td colspan="9" class="td2">中部</td></tr>
			<!--{elseif $key=='app'}-->
			<tr><td colspan="9" class="td2">下部</td></tr>
			<!--{/if}-->
		
		
		<!--{loop $slideGroup $slide}-->
		<!--{eval $k=$slide['code'];}-->
		<tr>
			<td class="td2"><input type="checkbox" name="chk[]" value="{$k}" /></td>
			<td class="td2"><input type="text" name="slide[{$key}][{$k}][order]" value="{$slide[order]}" size="1" /></td>
			<td class="td2">
				<input type="text" name="slide[{$key}][{$k}][name]" value="{$slide[name]}" style="width:80px; height:15px;"/>
			</td>
			<td class="td2">
				<input type="text" name="slide[{$key}][{$k}][code]" value="{$slide[code]}" style="width:80px; height:15px;" />
			</td>
			<td class="td2">
				<input type="text" name="slide[{$key}][{$k}][url]" value="{$slide[url]}" style="width:300px; height:15px;"/>
			</td>
			<td class="td2">
				<select name="slide[{$key}][{$k}][target]" id="slide[{$key}][{$k}][target]" style="width:80px;">
					<option value="_parent"  {eval if({$slide[target]} =="_parent") echo "selected=selected";} >本窗口</option>
					<option value="_blank"  {eval if({$slide[target]} =="_blank") echo "selected=selected";} >新窗口</option>
		  		</select>
			</td>
			<td class="td2"><input type="checkbox" name="slide[{$key}][{$k}][avaliable]" {eval $echo=''; if($slide[avaliable] == 1) $echo="checked";} $echo value="1"/></td>
            <!--新导航 13/11/04 begin-->
            <td class="td2"><input type="checkbox" name="" checked/></td>
            <td class="td2"><input type="checkbox" name="" checked/></td>
            <td class="td2"><input type="checkbox" name="" checked/></td>            
            <!--新导航 13/11/04 end-->
            
            
            
            
            
			<td class="td2">
				<input type="file" data-group="{$key}" data-name="{$k}" name="{$k}_icon" style="width:150px; height:15px;" onchange="uploadicon(this);return false;"/>
				<input type="hidden" id="show_image_{$k}_icon_value" name="slide[{$key}][{$k}][icon]" value="{$slide[icon]}">

			</td>
			<td class="td2">
			
			<img width="15px" height="15px" src="{$slide[icon]}" id="show_image_{$k}_icon" <!--{if !$slide[icon]}-->style="display:none;"<!--{/if}-->>
			</td>
		</tr>
		<!--{/loop}-->
		<tr>
			<td class="td2" colspan="2"></td><td colspan="7" class="td2"><a href="javascript:;" onclick="addrow(this, 0,'{$key}')" class="addCategory">添加导航</a></td>
		</tr>
		<!--{/loop}-->
		
		
		<tr>
			<td class="td2"><!-- <input class="checkbox" type="checkbox" id="chkall" name="chkall" onclick="checkall(this.form, 'chk')" ><label for="chkall">删</label> --></td>
			<td colspan="9" class="td2">
				<center><input class="button" type="submit" name="cronssubmit" value="提 交"></center>
			</td>
		<tr>
	  </table>
	</form>
</div>